extends Base1
var RUN_SPEED=50.00
@onready var monster=$"../.."
@onready var ani_sprite:AnimatedSprite2D=$"../../Graphics/AnimatedSprite2D"
func enter():
	if monster.health>0:
		ani_sprite.play("Idle")
	else:
		ani_sprite.play("die")
		monster.add_to_group("can_be_parasited")
		return

func do():
	var vec:Vector2=Vector2.ZERO
	monster.velocity.x=vec.x*RUN_SPEED
	monster.move_and_slide()

func _on_animated_sprite_2d_animation_finished():
	if ani_sprite.animation=="Take_hit":
		get_parent().change_state(0)
	pass
